import {Inject, Injectable} from '@nestjs/common';
import {REQUEST} from "@nestjs/core";
import {Request} from "express";
import {User} from "@/entitys/base/user.entity";

export interface StrengthenRequest extends Request {
    user?: User;
}

@Injectable()
export class RequestService {
    constructor(@Inject(REQUEST) private readonly request: StrengthenRequest) {

    }

    getUser(): User | undefined {
        return this.request.user;
    }

}
